Repository navigation
fix: return 404 instead of 401 for terminated sessions - #57
Draft
felixweinberger wants to merge 1 commit into
Draft
felixweinberger wants to merge 1 commit into
felixweinberger wants to merge 1 commit into
Conversation
The spec requires HTTP 404 for a request that carries a terminated session ID, so the client knows to re-initialize. A 401 made clients retry auth with a token that was still valid. Another user's session gets the same 404, so the response does not reveal which session IDs are live. Co-authored-by: fweinberger <fweinberger@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/mcpreturned 401 for a session that had ended (5 min idle timeout, DELETE, server restart). The spec says the server MUST return 404 so the client starts a new session. With 401, clients retry auth with a token that is still valid and never recover.-32001,Session not found.WWW-Authenticate.Fixes #11
Test plan
npm run build,npm run lint,npm testpass. The new tests fail onmain(401 received). Run locally with the example app servers at 2.0.3 rather than the locked 2.0.4; they aren't on this path.Generated by Claude Code